package com.zbkj.common.request.traceability;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 商品批次请求对象
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BatchesRequest对象", description="商品批次请求参数")
public class BatchesRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "批次主键ID，编辑时必传")
    private Long id;

    @ApiModelProperty(value = "商品ID", required = true)
    @NotNull(message = "商品ID不能为空")
    private Integer productId;

    @ApiModelProperty(value = "商家ID", required = true)
    @NotNull(message = "商家ID不能为空")
    private Integer merchantId;

    @ApiModelProperty(value = "批次名称")
    private String batchName;

    @ApiModelProperty(value = "开始号段", required = true)
    @NotNull(message = "开始号段不能为空")
    private Long startSerial;

    @ApiModelProperty(value = "结束号段", required = true)
    @NotNull(message = "结束号段不能为空")
    private Long endSerial;

    @ApiModelProperty(value = "生产日期/出生日期", required = true)
    @NotNull(message = "生产日期不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date productionDate;

    @ApiModelProperty(value = "排序字段，值越小越靠前")
    private Integer sortOrder = 0;

    @ApiModelProperty(value = "批次状态：0-待处理，1-生产中，2-已完成")
    private Integer status = 0;

    @ApiModelProperty(value = "下单用户ID")
    private Integer userId;

    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @ApiModelProperty(value = "是否手动设置批次名称")
    private Boolean isManualSetBatchName = false;
}
